﻿using System.Windows;
using CuteRibs.WowArmory.ViewModels;
using System;

namespace CuteRibs.WowArmory.Views
{
	public partial class RealmDetailPageView : PageBase
	{
		private RealmsPageViewModel viewModel { get { return this.ViewModel as RealmsPageViewModel; } }

		public RealmDetailPageView()
		{
			InitializeComponent();
		}

		private void btnSearch_Click(object sender, System.EventArgs e)
		{
			this.viewModel.NavigateToSearchPage();
		}

		private void Grid_Tap(object sender, System.Windows.Input.GestureEventArgs e)
		{
			var element = sender as FrameworkElement;
			this.viewModel.NavigateToDetailPage(element.Tag as string);
		}

		private void mnuDelete_Click(object sender, EventArgs e)
		{
			var control = sender as FrameworkElement;
			var vm = control.DataContext as RealmViewModel;
			this.viewModel.DeleteRealm(vm.Realm.Slug);
		}

		private void btnRefresh_Click(object sender, System.EventArgs e)
		{
			// TODO: Add event handler implementation here.
		}

		private void btnAddRemove_Click(object sender, System.EventArgs e)
		{
			// TODO: Add event handler implementation here.
		}
	}
}